import request from '@/utils/request'

// 保存数据
export function save(dict) {
  return request({
    url: '/auth/sysAuthResource/save',
    method: 'post',
    data: dict
  })
}

// 获取分页数据
export function getList(listQuery) {
  return request({
    url: '/auth/sysAuthResource/getByPage',
    method: 'get',
    params: listQuery
  })
}

// 获取子资源
export function getChlildRes(parentId) {
  return request({
    url: '/auth/sysAuthResource/getChlildRes',
    method: 'get',
    params: {
      parentId: parentId
    }
  })
}

// 数据
export function getDataById(id) {
  return request({
    url: '/auth/sysAuthResource/getById',
    method: 'get',
    params: {
      id: id
    }
  })
}

// 删除数据
export function delData(data) {
  return request({
    url: '/auth/sysAuthResource/del',
    method: 'post',
    data: data
  })
}

// 获取所有资源
export function getAllResource() {
  return request({
    url: '/auth/sysAuthResource/getAllResource',
    method: 'get'
  })
}
